//
//  WYHttpServer+CJAuthentication.m
//  Boss
//
//  Created by admin on 2018/9/14.
//  Copyright © 2018年 admin. All rights reserved.
//

#import "WYHttpServer+CJAuthentication.h"

@implementation WYHttpServer (CJAuthentication)
+(void)getAuthenticationStatusSucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlCertificationStatus WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
    
    
}

+(void)checkFirmStatusSucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlCertificationCheckFirmCertification WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}




+(void)sendPersonAuthenticationMessageWithUserName:(NSString *)userName WithIDNumber:(NSString *)idNumber SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    
    [parm setValue:userName forKey:@"userName"];
    [parm setValue:idNumber forKey:@"idNumber"];
    
    
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlCertificationUserCertification WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
    
    
    
}

+(void)sendFirmAuthenticationMessageWithUserName:(NSString *)userName WithPositon:(NSString *)position WithFirmName:(NSString *)firmName WithIdCardFront:(NSString *)idCardFront WithIdCardBack:(NSString *)idCardBack WithVerifyType:(NSString *)verifyType WithVerify:(NSString *)verifyUrl SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    
    [parm setValue:userName forKey:@"userName"];
    [parm setValue:position forKey:@"position"];
    [parm setValue:firmName forKey:@"firmName"];
    [parm setValue:idCardFront forKey:@"idCardFront"];
    [parm setValue:idCardBack forKey:@"idCardBack"];
    [parm setValue:verifyType forKey:@"verifyType"];
    [parm setValue:verifyUrl forKey:@"verifyUrl"];

    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlCertificationFirmCertification WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
    
    
    
    
    
    
}



/**
 * 我的公司
 */
+(void)getMyFirmStatusSucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlCertificationMyFirm WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
    
    
}

/**
 *   编辑我的公司
 */
+(void)editMyFirmWithBrandName:(NSString *)brandName WithFirmIntroduction:(NSString *)firmIntroduction WithFirmType:(NSString *)firmType WithFirmLogo:(NSString *)firmLogo SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:brandName forKey:@"brandName"];
    [parm setValue:firmIntroduction forKey:@"firmIntroduction"];
    [parm setValue:firmType forKey:@"firmType"];
    [parm setValue:firmLogo forKey:@"firmLogo"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlCertificationEditFirm WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}

+(void)deleteFirmHonorWithID:(NSString *)ID SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:ID forKey:@"id"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlCertificationDeleteFirmHonor WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}

+(void)deleteFirmProductWithID:(NSString *)ID SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:ID forKey:@"id"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlCertificationDeleteFirmProduct WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}

+(void)insertFirmHonorWithUrl:(NSString *)url SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:url forKey:@"url"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlCertificationInsertFirmHonor WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}

+(void)insertFirmProductWithUrl:(NSString *)url WithProductName:(NSString *)productName WithProductCover:(NSString *)productCover WithProductId:(NSString *)productId WithProductDetails:(NSString *)productDetails SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:url forKey:@"url"];
    [parm setValue:productName forKey:@"productName"];
    [parm setValue:productCover forKey:@"productCover"];
    [parm setValue:productDetails forKey:@"productDetails"];
    [parm setValue:productId forKey:@"id"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlCertificationInsertFirmProduct WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
    
    
    
}

+(void)getFirmUserWithFirmId:(NSString *)firmId SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:firmId forKey:@"firmId"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlUserFirmUser WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
    
    
    
}










@end
